package OOPAndMultiThreadArchiveManager.Client.Models;

import com.fasterxml.jackson.annotation.JsonIgnore;

import java.util.regex.Pattern;

public class UserChange {
    public String originUserName;
    public UserInfo changedUserInfo;

    @JsonIgnore
    public boolean isValid() {
        var regex = Pattern.compile("^[a-zA-Z\\d._]{1,128}$");
        return changedUserInfo.isValid() && regex.matcher(originUserName).matches();
    }
}
